<?php

/*
 * 节点管理
 */

namespace app\common\model;

use think\Db;

class Type extends \think\Model
{

    /**
     * 根据父节点获取可用节点
     * @param type $pid
     * @param type $fields
     * @return type
     */
    public function getTypeByPid($pid = 0, $fields = '*')
    {
        return Db::name('type')
                ->where(['pid' => $pid, 'status' => 1, 'isdelete' => 0])
                ->field($fields)
                ->select();
    }

}
